#include <glib.h>

gint main(gint argc, gchar **argv)
{
    GRand *rand;

    const guint32 seed_array[] =
    {
      0xbeefbeef,
      0xfeedfeed,
      0xfeedbeef,
      0xbeeffeed
    };

    rand = g_rand_new_with_seed(65535);
    g_print("seed-65535: %d \n", g_rand_int(rand));
    g_print("seed-65535: %d \n", g_rand_int(rand));
    g_print("seed-65535: %d \n", g_rand_int_range(rand, 100, 200));
    g_print("seed-65535: %d \n", g_rand_int_range(rand, 100, 200));

    g_rand_set_seed(rand, 888);
    g_print("seed-888: %d \n", g_rand_int(rand));
    g_print("seed-888: %d \n", g_rand_int_range(rand, 100, 200));

    g_rand_set_seed_array(rand, seed_array, G_N_ELEMENTS (seed_array));
    g_print("seed-array: %d \n", g_rand_int(rand));
    g_print("seed-array: %d \n", g_rand_int_range(rand, 100, 200));

    g_rand_free(rand);

    return 0;
}